JpegRawOrganizer-0.1.0.0: Short description of your package

Safe HaskellSafe
LanguageHaskell2010

Core

Description

The coreModule is the core of the Programm, it handles core functionality. this functionallity is in reading file indexes of directories, comapring the files read, and deleting or moving files. to be more concrete, the core reads (and filters) a directory containing so called jpeg files and one containing so called raw files then it comapares the two lists (jpeg list and raw list). in order to find all raw files, that have no matching jpeg file. (called differences) in the last step, the core, depending on the settings, deletes or moves all differences. Info: For simplicitie's sake the files matching the rawEnding of the settings are calleds raw files and the files matching the jpegEnding are called jpeg files even they could have any ending and could be files of any type.

Synopsis

Documentation

data PhotoSetting Source #

data PhotoSetting PhotoSetting is a Data structure, that reprensents parameters which have to be set, bevore the Programm can do its job.

Constructors

PhotoSetting 

Fields

  • jpegPath :: String

    the Path where the Jpegs are located. (the path with the less ammount of files.)

  • rawPath :: String

    the Path where the Raw Files are located. (the path, containing some files to move or delete.)

  • binPath :: String

    the Path where Raw files, should be moved to.

  • deleteFiles :: Bool

    a flag. if True, the files will be deleted. If False, the files will be moved to the specified binPath.

  • rawEnding :: String

    the file extension of the files, which should be classified as "Raw files" for example ".CR2"

  • jpegEnding :: String

    the filex extension of the files, which should be classified as "Jpeg file" for example ".jpg"

Instances

Eq PhotoSetting Source # 
Show PhotoSetting Source #

this instance of show, formats the Photosettings String to make it appear more beautiful.

data PhotoFile Source #

data PhotoFile This data represents a Photo File, or generally spoken a File.

Constructors

PhotoFile 

Fields

Instances

Eq PhotoFile Source #

in this instance of eq, two PhotoFiles are equal, iff their names are equal.

Ord PhotoFile Source # 
Show PhotoFile Source # 

loadAndGetDifference Source #

Arguments

:: PhotoSetting

the PhotoSettings, containing all relevant paths.

-> IO [PhotoFile]

a List of "Raw" PhotoFiles, which have not counterpart in the Jpeg File list.

loadAndGetDifference receives PhotoSettings. at first it load both, in the settings specified paths (rawPath and jpegPath) then it creates PhotoFiles out of the FileLists and filters them, using the raw- and jpegending, also specified in the settings. then it compares both lists, and returns a list of all "Raw Files", that have no counterpart in the "Jpeg Files" list.

deleteDifferenceFiles Source #

Arguments

:: PhotoSetting

PhotoSettings, containing the relevant Paths and extensions.

-> IO [PhotoFile]

A List of PhotoFiles, that have been deleted.

deleteDifferenceFiles gets some PhotoSettings. At first it loads from the specific paths, and calculates the Raw Files, wich have no counterpart in the Jpeg List then it deletes the calculated Raw Files.

moveDifferenceFilesToBin Source #

Arguments

:: PhotoSetting

PhotoSettings, containing the relevant Paths and extensions.

-> IO [PhotoFile]

a List of PhotoFiles, that have been moved to the binPath.

moveDifferenceFilesToBin gets some PhotoSettings. At first it loads from the specific paths, and calculates the Raw Files, wich have no counterpart in the Jpeg List then it moves the calculated Raw Files into the specified binPath

toPhotoFile Source #

Arguments

:: FilePath

a FilePath containing the Path, a Filename and a File extension.

-> PhotoFile

a PhotoFile Representation generated from the Path.

toPhotoFiles gets a FilePath aka String, which contains the Path, the Filename and the fileextension. then it cuts the Path in three Parts and returns a PhotoFile.

concatFilePath Source #

Arguments

:: PhotoFile

a Photofile Representation

-> FilePath

The FilePath, representing the Photofile.

concatFilePath is the reverse function of toPhotoFile. It needs a PhotoFile, and concats its part to a fully qualified FilePath, with path, filename and file extension.

getFilepathsFromPhotoFiles Source #

Arguments

:: [PhotoFile]

a list of Photofiles, which are needed the FilePaths from

-> [FilePath]

the list of FilePaths, made out of the list of PhotoFiles.

getFilepathsFromPhotofile gets a list of Photofiles, and produces a list of FilePaths out of it.

addPathToPhotoFiles Source #

Arguments

:: [PhotoFile]

a list of PhotoFiles, where the path sould be set.

-> FilePath

a path to set as path of all Photofiles in the list.

-> [PhotoFile]

a list of Photofiles with the specified path set.

addPathToPhotoFiles gets a list of Photofiles and a FilePath, and sets the specified path as path of any photoFile in the list. its like an giant "setter" setting the same attribute in all objects in the list aka produces a new list with the path as path of each listitem.